/*  1:   */ package org.jetbrains.io;
/*  2:   */ 
/*  3:   */

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.QueryStringDecoder;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */ 
/* 11:   */ abstract class DelegatingHttpRequestHandlerBase
/* 12:   */   extends SimpleChannelInboundHandler<FullHttpRequest>
/* 13:   */ {
/* 14:   */   protected void messageReceived(ChannelHandlerContext paramChannelHandlerContext, FullHttpRequest paramFullHttpRequest)
/* 15:   */     throws Exception
/* 16:   */   {
/* 17:27 */     if (BuiltInServer.LOG.isDebugEnabled()) {
/* 18:29 */       BuiltInServer.LOG.debug("IN HTTP: " + paramFullHttpRequest.getUri());
/* 19:   */     }
/* 20:32 */     if (!process(paramChannelHandlerContext, paramFullHttpRequest, new QueryStringDecoder(paramFullHttpRequest.getUri()))) {
/* 21:33 */       Responses.sendStatus(HttpResponseStatus.NOT_FOUND, paramChannelHandlerContext.channel(), paramFullHttpRequest);
/* 22:   */     }
/* 23:   */   }
/* 24:   */   
/* 25:   */   protected abstract boolean process(ChannelHandlerContext paramChannelHandlerContext, FullHttpRequest paramFullHttpRequest, QueryStringDecoder paramQueryStringDecoder)
/* 26:   */     throws Exception;
/* 27:   */   
/* 28:   */   public void exceptionCaught(ChannelHandlerContext paramChannelHandlerContext, Throwable paramThrowable)
/* 29:   */     throws Exception
/* 30:   */   {
/* 31:   */     try
/* 32:   */     {
/* 33:42 */       NettyUtil.log(paramThrowable, BuiltInServer.LOG);
/* 34:   */     }
/* 35:   */     finally
/* 36:   */     {
/* 37:45 */       paramChannelHandlerContext.channel().close();
/* 38:   */     }
/* 39:   */   }
/* 40:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.io.DelegatingHttpRequestHandlerBase

 * JD-Core Version:    0.7.0.1

 */